package money;

import java.rmi.MarshalException;

public class salary {
	public static double sum(double number1, double number2,double number3) throws Exception {
		if (number1 < 0 || number2 < 0 || number3 < 0) {
			throw new Exception("不可以使用负数");
		}
		return (number1 + number2 + number3);
	}
	public static double sum(double number1, double number2) throws Exception {
		if (number1 < 0 || number2 < 0) {
			throw new Exception("不可以使用负数");
		}
		return (number1 + number2);
	}
	public static double sum(double number1) throws Exception {
		if (number1 < 0) {
			throw new Exception("不可以使用负数");
		}
		return (number1);
	}
	public final static int x = 50;
	public final static int y = 30;

	public static double avg(double num) throws Exception {

		if (num > x) {
			num = num * 0.95;
		}
		if (num > y) {
			num = num * 0.9;
		}
		if (num < x) {
			throw new Exception("不需要交税");
		}
		return num;
	}
}